home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 December / Australian PC User - December 2003 (CD2).iso / software / apps / files / dwmx2k4.exe / Disk1 / data1.cab / Configuration_En / Objects / Media / Applet.js < prev    next >
Encoding:
JavaScript  |  2003-09-05  |  1.4 KB  |  36 lines

  1. // Copyright 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  2.  
  3. function isDOMRequired() { // Return false, indicating that this object is available in code view.
  4.     return false;
  5. }
  6.  
  7. function objectTag() {  // Return the html tag that should be inserted
  8.   var breakpoint, classname, newpath, retStr, path;
  9.   var bDialogState = dw.getShowDialogsOnInsert(); // Was dialog shown?
  10.   
  11.   path = dw.doURLEncoding(browseForFileURL());
  12.  
  13.   if ((path == '')  && bDialogState) {  return ''; }
  14.  
  15.   breakpoint = path.lastIndexOf("/");
  16.   if (breakpoint > 0) {
  17.     newpath = path.substring(0,breakpoint);
  18.     classname = path.substring(breakpoint + 1,path.length);
  19.     retStr = '<applet code="' + classname + '" codebase = "' + newpath + '" width="32" height="32"></applet>';
  20.   } else retStr = '<applet code="' + path + '" width="32" height="32"></applet>';
  21.  
  22.   prefsAccessibilityOption = dw.getPreferenceString("Accessibility", "Accessibility Media Options", "");
  23.   if (prefsAccessibilityOption == 'TRUE')  {retStr = addAccessibility(retStr);}
  24.  
  25.   return retStr
  26. }
  27.  
  28. function addAccessibility(retStr) {
  29.    var cmdFile = dreamweaver.getConfigurationPath() + "/Commands/AppletOptions.htm";
  30.    var cmdDOM = dreamweaver.getDocumentDOM(cmdFile);
  31.    
  32.    cmdDOM.parentWindow.setFormItem(retStr);
  33.    dreamweaver.popupCommand("AppletOptions.htm");
  34.    return (cmdDOM.parentWindow.returnAccessibilityStr(retStr));    
  35. }
  36.